# Hey Emacs, this is a -*- makefile -*-

ERRNO_DEVICES = at90s2313
ERRNO_DEVICES += at90s2323
ERRNO_DEVICES += at90s2333
ERRNO_DEVICES += at90s2343
ERRNO_DEVICES += attiny22
ERRNO_DEVICES += attiny26
ERRNO_DEVICES += at90s4414
ERRNO_DEVICES += at90s4433
ERRNO_DEVICES += at90s4434
ERRNO_DEVICES += at90s8515
ERRNO_DEVICES += at90c8534
ERRNO_DEVICES += at90s8535
ERRNO_DEVICES += ata6289
ERRNO_DEVICES += attiny13
ERRNO_DEVICES += attiny13a
ERRNO_DEVICES += attiny2313
ERRNO_DEVICES += attiny2313a
ERRNO_DEVICES += attiny24
ERRNO_DEVICES += attiny24a
ERRNO_DEVICES += attiny4313
ERRNO_DEVICES += attiny44
ERRNO_DEVICES += attiny44a
ERRNO_DEVICES += attiny84
ERRNO_DEVICES += attiny25
ERRNO_DEVICES += attiny45
ERRNO_DEVICES += attiny85
ERRNO_DEVICES += attiny261
ERRNO_DEVICES += attiny261a
ERRNO_DEVICES += attiny461
ERRNO_DEVICES += attiny861 
ERRNO_DEVICES += attiny861a
ERRNO_DEVICES += attiny43u
ERRNO_DEVICES += attiny87
ERRNO_DEVICES += attiny48
ERRNO_DEVICES += attiny88
ERRNO_DEVICES += at86rf401
ERRNO_DEVICES += at43usb320
ERRNO_DEVICES += at43usb355
ERRNO_DEVICES += at76c711
ERRNO_DEVICES += atmega103
ERRNO_DEVICES += at90usb82
ERRNO_DEVICES += at90usb162
ERRNO_DEVICES += atmega8u2
ERRNO_DEVICES += atmega16u2
ERRNO_DEVICES += atmega32u2
ERRNO_DEVICES += attiny167
ERRNO_DEVICES += atmega8
ERRNO_DEVICES += atmega48
ERRNO_DEVICES += atmega48a
ERRNO_DEVICES += atmega48p
ERRNO_DEVICES += atmega88
ERRNO_DEVICES += atmega88a
ERRNO_DEVICES += atmega88p
ERRNO_DEVICES += atmega88pa
ERRNO_DEVICES += atmega8515
ERRNO_DEVICES += atmega8535
ERRNO_DEVICES += atmega8hva
ERRNO_DEVICES += atmega4hvd
ERRNO_DEVICES += atmega8hvd
ERRNO_DEVICES += at90pwm1
ERRNO_DEVICES += at90pwm2
ERRNO_DEVICES += at90pwm2b
ERRNO_DEVICES += at90pwm3
ERRNO_DEVICES += at90pwm3b
ERRNO_DEVICES += at90pwm81
ERRNO_DEVICES += atmega16
ERRNO_DEVICES += atmega16a
ERRNO_DEVICES += atmega161
ERRNO_DEVICES += atmega162
ERRNO_DEVICES += atmega163
ERRNO_DEVICES += atmega164a
ERRNO_DEVICES += atmega164p
ERRNO_DEVICES += atmega165
ERRNO_DEVICES += atmega165p
ERRNO_DEVICES += atmega168
ERRNO_DEVICES += atmega168a
ERRNO_DEVICES += atmega168p
ERRNO_DEVICES += atmega169
ERRNO_DEVICES += atmega169a
ERRNO_DEVICES += atmega169p
ERRNO_DEVICES += atmega169pa
ERRNO_DEVICES += atmega16c1
ERRNO_DEVICES += atmega16hva
ERRNO_DEVICES += atmega16hva2
ERRNO_DEVICES += atmega16hvb
ERRNO_DEVICES += atmega16m1
ERRNO_DEVICES += atmega16u4
ERRNO_DEVICES += atmega32
ERRNO_DEVICES += atmega323
ERRNO_DEVICES += atmega324a
ERRNO_DEVICES += atmega32 
ERRNO_DEVICES += atmega324pa
ERRNO_DEVICES += atmega325
ERRNO_DEVICES += atmega325p
ERRNO_DEVICES += atmega3250
ERRNO_DEVICES += atmega3250p
ERRNO_DEVICES += atmega328
ERRNO_DEVICES += atmega328p
ERRNO_DEVICES += atmega329
ERRNO_DEVICES += atmega329p
ERRNO_DEVICES += atmega329pa
ERRNO_DEVICES += atmega3290
ERRNO_DEVICES += atmega3290p
ERRNO_DEVICES += atmega32c1
ERRNO_DEVICES += atmega32hvb
ERRNO_DEVICES += atmega32m1
ERRNO_DEVICES += atmega32u4
ERRNO_DEVICES += atmega32u6
ERRNO_DEVICES += atmega406
ERRNO_DEVICES += atmega64
ERRNO_DEVICES += atmega640
ERRNO_DEVICES += atmega644
ERRNO_DEVICES += atmega644a
ERRNO_DEVICES += atmega644p
ERRNO_DEVICES += atmega644pa
ERRNO_DEVICES += atmega645
ERRNO_DEVICES += atmega645a
ERRNO_DEVICES += atmega645p
ERRNO_DEVICES += atmega6450
ERRNO_DEVICES += atmega6450a
ERRNO_DEVICES += atmega6450p
ERRNO_DEVICES += atmega649
ERRNO_DEVICES += atmega649a
ERRNO_DEVICES += atmega649p
ERRNO_DEVICES += atmega6490
ERRNO_DEVICES += atmega6490a
ERRNO_DEVICES += atmega6490p
ERRNO_DEVICES += atmega64c1
ERRNO_DEVICES += atmega64
ERRNO_DEVICES += atmega64hve
ERRNO_DEVICES += at90can32
ERRNO_DEVICES += at90can64
ERRNO_DEVICES += at90pwm216
ERRNO_DEVICES += at90pwm316
ERRNO_DEVICES += at90scr100
ERRNO_DEVICES += at90usb646
ERRNO_DEVICES += at90usb647
ERRNO_DEVICES += at94k
ERRNO_DEVICES += atmega128
ERRNO_DEVICES += atmega1280
ERRNO_DEVICES += atmega1281
ERRNO_DEVICES += atmega1284p
ERRNO_DEVICES += atmega128rfa1
ERRNO_DEVICES += at90can128
ERRNO_DEVICES += at90usb1286
ERRNO_DEVICES += at90usb1287
ERRNO_DEVICES += m3000f
ERRNO_DEVICES += m3000s
ERRNO_DEVICES += m3001b
ERRNO_DEVICES += atmega2560
ERRNO_DEVICES += atmega2561

ERRNO_OBJS=$(ERRNO_DEVICES:%=$(OBJDIR)/%/avr-drv-errno.o)

ERRNO_TARGETS=$(ERRNO_DEVICES:%=$(OUTDIR)/%/avr-drv-errno.a)

ERRNO_OBJDIRS=$(ERRNO_DEVICES:%=$(OBJDIR)/%)
ERRNO_OUTDIRS=$(ERRNO_DEVICES:%=$(OUTDIR)/%)

$(OBJDIR)/%/avr-drv-errno.o : avr-drv-errno.c avr-drv-errno.h
	$(CC) -c -mmcu=$* $(ALL_CFLAGS) $< -o $@

$(OUTDIR)/%/avr-drv-errno.a: $(ERRNO_OBJS)
	$(AR) $@ $(OBJDIR)/$*/avr-drv-errno.o

# Create object files directory
$(shell mkdir -p $(ERRNO_OBJDIRS))
$(shell mkdir -p $(ERRNO_OUTDIRS))
